{% extends "mainPage.html" %}
{% load static %}

{% block main_body %}
  <div id="main_body">
    <fieldset class="Web_Operation" style="height: 99%;width: 99%">
        <legend><h3>控制操作区</h3></legend>
        <div id="control-form" style="margin-left: 3%;margin-top: 10px;width: 37%;float: left">
            <form class="form" id="log-form" action="{% url 'data_encode' %}" method="POST">
                {% csrf_token %}
                <div>
                    <input type="button" value="启动定时任务" id="start_job" class="button_class"/>
                    <input type="button" value="停止定时任务" id="end_job" class="button_class"/>
                    <input type="button" value="启动代理服务" id="start_proxy" class="button_class"/>
                    <input type="button" value="停止代理服务" id="end_proxy" class="button_class"/>
                    <input type="button" value="重启工具服务" id="start_flask" class="button_class"/>
                </div>
                <p>
                     <input type="submit" value="提交加密" id="act_jm" class="button_class"/>
                     <input type="password" name="password" value="" class="input_text" style="width: 30%"
                                       placeholder="--输入密码获得加密字符串--"/>
                </p>
            </form>
        </div>
        <div id="admin-link" style="width: 15%;float: left">
            <p><h3><a href="/admin/job/jobconfig/">配置定时任务</a></h3></p>
            <p><h3><a href="/admin/job/groupinfo/">维护钉钉群人员信息</a></h3></p>
            <p><h3><a href="/admin/job/filespath/">配置可编辑文件路径</a></h3></p>
        </div>
    </fieldset>
  </div>

  <div id="sec_body">
      <fieldset class="Web_Operation" style="width: 99.5%">
          <legend><h3>文件编辑区</h3></legend>
<!--          <script src="/static/ckeditor/ckeditor.js"></script>-->
          <form method="post" enctype="multipart/form-data" action="/job/modify/">
              {% csrf_token %}
              <div class="row_edit" style="margin-left: 3%;margin-top: 10px">
                  <input type="submit" value="执行操作" id="get_config" class="button_class"/>
                  <select name="op_type" class="select">
<!--                        <option value="0">&#45;&#45;请选择&#45;&#45;</option>-->
                        {% for sp in op_types %}
                           <option value="{{ sp }}">{{ sp }}</option>
                        {% endfor %}
                    </select>
                  <select name="config_filename" class="select" style="width: 500px">
<!--                        <option value="0">&#45;&#45;请选择&#45;&#45;</option>-->
                        {% for sp in filenames %}
                           <option value="{{ sp.id }}">{{ sp.cn_name }}</option>
                        {% endfor %}
                  </select>
              </div>
              <div id="show-editor">
                  <textarea name="content" style="display:none;" id="add_info">{{content}}</textarea>
              </div>
          </form>
          <link rel="stylesheet" href="{% static 'editor/css/editormd.min.css' %}">
          <script src="{% static 'editor/editormd.min.js' %}"></script>
          <script type="text/javascript">
              $(function() {
                    var showEditor;
                    showEditor = editormd("show-editor", {
                        width  : "99.5%",
                        height : "520px",
                        path   : "{% static 'editor/lib/' %}",
                        watch: false,
                        {#toolbarIcons: true,#}
                        previewCodeHighlight : true,
                        toolbarIcons: function () {  //自定义工具栏，后面有详细介绍
                            return editormd.toolbarModes['mini']; // full, simple, mini
                        },
                    });
                    {#showEditor.hideToolbar();#}
                })
          </script>
      </fieldset>
  </div>
{% endblock %}

